feat(cli/tui): wrapping input, bottom-pinned bar, live streaming, richer rendering#3
Merged
Merged
Conversation
…her rendering Overhaul the interactive CLI (ratatui) session UX so it reads and behaves like a modern chat front-end: - Input box: soft-wrap long lines onto continuation rows and grow the box height (up to 10 rows) instead of clipping the overflow off the right edge; the cursor tracks the wrapped position. Adds wrap_cells/input_rows. - Layout: pin the status/input/hints cluster to the bottom of the window so the input bar no longer slides down as the conversation grows; the history pane flexibly fills the space above and scrolls to keep the latest output in view. - Live streaming: consume the raw reply stream and render assistant text token-by-token as a live preview, committing it as Markdown once the run completes (replaces the whole-message coalescer in this path) — so streaming is visible AND tables/code/lists still render correctly. - Type while the agent works: full input editing stays live during a response; Enter queues the message (surfaced as "N queued" in the box title) and it is submitted automatically after the current turn finishes. Ctrl-C stops the in-flight turn. - User vs agent: render the user's own turns as a left-barred, softly-shaded block so they are instantly distinguishable from the agent's reply. - Slash palette: Enter (not only Tab) now accepts the highlighted entry instead of submitting the raw half-typed token, so arrow-key selection actually applies. - Markdown: render GFM tables as aligned box-drawing tables. commit_stream_to_session borrows &mut Conversation (a disjoint session field) rather than &mut CliSession, so it does not conflict with the reply stream's outstanding immutable borrow of session.agent. Tests: add coverage for input wrapping/growth, the streaming preview -> commit cycle, and box-drawing table rendering (9 tui tests pass).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Overhauls the interactive CLI (ratatui) session UX so it reads and behaves like a modern chat front-end.
Implementation notes
commit_stream_to_sessionborrows&mut Conversation(a disjoint session field) rather than&mut CliSession, so it doesn't conflict with the reply stream's outstanding immutable borrow ofsession.agent.Testing
9
session::tuiunit tests pass, including new coverage for input wrapping/growth, the streaming preview→commit cycle, and box-drawing table rendering. Also verified on-screen by driving the built binary in tmux: bottom-pinned input, multi-row wrapping, the slash palette, a streamed response with a box-drawing table and shaded user turn, and typing-while-streaming with the queued follow-up running next.🤖 Generated with Claude Code